#include<stdio.h>
#include<stdlib.h>
int g_val = 0;//已初始化全局数据
int g_unval;//未初始化全局数据
int main(int argc,char* argv[],char* env[])
{
    printf("环境变量地址:\n");
    for(int i = 0;env[i];i++)
        printf("env[%d]:%p\n",i,env[i]);

    printf("命令行参数地址:\n");
    for(int i = 0;argv[i];i++)
        printf("argv[%d]:%p\n",i,argv[i]);
  
    int a = 0,b = 0;
    printf("stack addr:%p\n",&a);
    printf("stack addr:%p\n",&b);

    int* heap1 = (int*)malloc(sizeof(int));
    int* heap2 = (int*)malloc(sizeof(int));
    int* heap3 = (int*)malloc(sizeof(int));
    printf("hea1 addr:%p\n",heap1);
    printf("hea2 addr:%p\n",heap2);
    printf("hea3 addr:%p\n",heap3);

    printf("init addr:%p\n",&g_val);
    printf("uninit addr:%p\n",&g_unval);
    const char* str = "hello";
    printf("string rdonly addr:%p\n",str);

    printf("code addr:%p\n",main);//函数的代码被放到代码区
    return 0;
}

